package stu.cms.exection;

import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.RestControllerAdvice;
import stu.cms.result.Result;

@RestControllerAdvice
public class ExceptionController {
    @ExceptionHandler(BaseException.class)
    public Result handleException(BaseException e){
        return Result.error(e.getMessage());
    }
}
